<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>车型销量TOP分析</title>
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.0/dist/echarts.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/pyecharts@1.9.0/dist/pyecharts.min.js"></script>
    <style>
        body { font-family: "Microsoft YaHei", Arial, sans-serif; margin: 0; padding: 20px; }
        .chart-container { margin-bottom: 40px; }
        h1 { color: #333; text-align: center; }
        .info-box { background-color: #f5f5f5; padding: 15px; border-radius: 5px; margin-bottom: 20px; }
    </style>
</head>
<body>
    <h1>车型销量TOP分析</h1>

    <div class="info-box">
        <p>以下是销量排名前十的车型及其销量数据可视化展示，包含多种图表类型以便从不同角度分析数据。</p>
        <p>选取标准：根据各车型所有年份的累计销量进行排名，展示销量最高的前10个车型。</p>
    </div>

    <div class="chart-container">
        {{ chart_html|safe }}
    </div>

    <div style="margin-top: 30px; overflow-x: auto;">
        <table border="1" cellpadding="8" style="width: 100%; border-collapse: collapse;">
            <thead>
                <tr style="background-color: #f0f0f0;">
                    <th>排名</th>
                    <th>车型</th>
                    <th>制造商</th>
                    <th>总销量(辆)</th>
                </tr>
            </thead>
            <tbody>
                {% for i in range(top_models|length) %}
                <tr>
                    <td>{{ i+1 }}</td>
                    <td>{{ top_models[i] }}</td>
                    <td>{{ model_manufacturers[i] }}</td>  {# 简化引用，直接使用索引 #}
                    <td>{{ top_sales[i] }}</td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</body>
</html>